// utils/Components/time-label/time-label.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {

        value: {
            type: "number",
            value: "0.0",
            observer: function (newVal, oldVal) {
                if(wx.sqtools.isString(newVal))
                {
                    newVal=parseFloat(newVal);
                }
                else if(wx.sqtools.isNumber(newVal))
                {
                    newVal=newVal
                }
                else{
                    newVal=0.0;
                }
                this.setData({
                    valueString: wx.su.scale(newVal, this.data.dbyte) + ''
                })

            }
        },
        dbyte: {
            type: "number",
            value: "0",
            observer: function (newVal, oldVal) {
                if(!wx.sqtools.isNumber(newVal))
                {
                    newVal=2
                }
                this.setData({
                    valueString: wx.su.scale(this.data.value, newVal) + ''
                })
            }
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        valueString: ''
    },

    /**
     * 组件的方法列表
     */
    methods: {}
})
